<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>唐人影视股份有限公司</title>
    <link type="text/css" rel="stylesheet" href="${basePath }/css/index.css" />
</head>

<body>
    <div class="bannerTop">
        <h2>唐人影视股份有限公司</h2>
        <a class="tr_logo" title="唐人影视" href="/">${config_Logo.configValue}</a>
        <div class="linksBox">
            <div class="linksBoxFix"></div>
            <a href="javascript:;" title="加入收藏" class="slideOuter" id="collectPage"> <span class="addFav">加入收藏</span> </a>

        </div>
        <div class="navBox">
            <ul class="clearfix">
            <#list navList as nav>
            <li id="nav1"> <a href="${basePath }/${nav.url}" target="_self" title="${nav.name}">${nav.name}<span>${nav.englishName}</span></a> </li>
            </#list>
            
            <!--
                <li id="nav1"> <a href="index.html" target="_self" title="首页">首页<span>Home</span></a> </li>
                <li id="nav2"> <a href="news.html" target="_self" title="新闻">新闻<span>News</span></a> </li>
                <li id="nav4"> <a href="tv.html" target="_self" title="电视剧">电视剧<span>TV Drama</span></a> </li>
                <li id="nav3"> <a href="movies.html" target="_self" title="电影">电影<span>Movie</span></a> </li>
                <li id="nav5"> <a href="other.html" target="_self" title="其他作品">其他作品<span>Others</span></a> </li>
                <li id="nav8"> <a href="linking.html" target="_self" title="友情链接">友情链接<span>Links</span></a> </li>
                <li id="nav9"> <a href="find.html" target="_self" title="唐人招聘">唐人招聘<span>Join
                            Us</span></a> </li>
                <li id="nav10"> <a href="about.html" target="_self" title="关于我们">关于我们<span>About
                            Us</span></a> </li>
            -->
            </ul>
        </div>
    </div>


    <div class="scrolPanl" id="scrollP">
        <div class="panelBox" id="scroll1">
            <div class="panel">
            <#list album as album>
            	<div class="panLf5">
	                 <a title="${album.name}" href="#" data-vid="1218952"><img src="${album.imagepath}" width="${album.width} " height="${album.height}"/></a>
	             </div>
            </#list>
            <!--
	            <div class="panLf5">
	                 <a title="唐人影视祝祖国生日快乐" href="#" data-vid="1218952"><img src="${basePath }/images/2019gq.jpg"/></a>
	             </div>
	             <div class="panLf5">
	                 <a title="《柜中美人》曝魅宫幻影片花" href="#" data-vid="1218952"><img src="${basePath }/images/柜中美人.png" width="326px" height="149px"/></a>
	             </div>
	             <div class="panLf5">
	                <a href="#" target="_blank"><img src="${basePath }/img/云之凡.jpg" width="158px " height="150px"/></a>
	            </div>
	            <div class="panLf5">
	                <a href="#" target="_blank"><img src="${basePath }/img/xj.jpg" width="158px " height="150px"/></a>
	            </div>
	            
	             <div class="panLf5">
	                <a href="#" target="_blank"><img src="${basePath }/img/仙剑奇侠传3.png"  width="326px" height="150px"/></a>
	            </div>
	            <div class="panLf5">
	                <a href="#" target="_blank"><img src="${basePath }/img/无心法师.png"  width="326px" height="150px"/></a>
	            </div>
	            
	            <div class="panLf5">
	                <a href="#" target="_blank"><img src="${basePath }/img/lbdt.jpg"  width="326px" height="150px"/></a>
	            </div>
	         -->
            <!--
                <div class="panLf">
                    <div class="panLf1">
                    <a title="《柜中美人》曝魅宫幻影片花" href="#" data-vid="1218952"><img src="${basePath }/images/柜中美人.png" width="326px" height="149px"/></a>
        
                    </div>
                    <div class="panLf5">
                        <a href="#" target="_blank"><img src="${basePath }/images/nymfz01.jpg" height: "308px" width: "156px" /></a>
                    </div>
                    <div class="panLf2">
                        <a title="《步步惊情》曝主题曲" href="#" data-vid="1218952"><img src="${basePath }/images/wuyuetian.jpg"  height: "149px" width: "158px"/></a>
                    </div>
                    <div class="panLf3">
                        <a title="胡歌获亚洲特别贡献奖" href="#" data-vid="1225757"><img src="${basePath }/images/hghj.jpg"  height: "149px" width: "158px"/></a>
                    </div>
                </div>
                <div class="panRt">
                    <div class="panRt1">
                        <a href="#" target="_blank"><img src="${basePath }/images/2019gq.jpg" alt="" class="bigpic" /></a>
                        <div class="titIntr dark-mask picIntr">
                            <h3><a href="#" target="_blank" title="2019国庆，祖国生日快乐">唐人影视祝伟大祖国七十华诞快乐！！！</a></h3>
                            <p>
                                <a href="#" target="_blank"></a>
                            </p>
                        </div>
                    </div>
                    <div class="panRt4 titIntr">
                    <a title="《柜中美人》全阵容剧照汹涌来袭" href="#" data-vid="1218952"><img src="${basePath }/images/柜中美人全阵容剧照.png" width="326px" height="149px"/></a>
                        
                    </div>
                    <div class="panRt3">
                        <a href="#" target="_blank"><img src="${basePath }/images/cfmv.jpg" class="smPic" /></a>
                        <div class="smPicint titIntr">
                            <h3><a href="#" target="_blank" title="《柜中美人》">《重返20岁》MV</a></h3>
                            <p><a href="#" target="_blank">发布主题曲MV《时间告诉我的事》</a></p>
                        </div>
                    </div>
                </div>
                
            </div>
            <div class="panel">
                <div class="panLf">
                    <div class="panLf1 titIntr">
                        <a title="仙剑奇侠传" href="#" data-vid="1225757"><img src="${basePath }/images/仙剑奇侠传.png" width="326px" height="149px"/></a>
                    </div>
                    <div class="panLf2">
                        <a title="《云之凡》片花" href="#" data-vid="1225775"><img src="${basePath }/images/yzfph.jpg" /></a>
                    </div>
                    <div class="panLf3">
                        <a title="" href="#" data-vid=""><img src="${basePath }/images/sp4.jpg" /></a>
                    </div>
                    <div class="panLf4 titIntr purp">
                        <a title="仙剑奇侠传" href="#" data-vid="1225757"><img src="${basePath }/images/仙剑奇侠传3.png" width="326px" height="149px"/></a>
                    </div>
                </div>
                <div class="panRt">
                    <div class="panRt1">
                        <a href="#" target="_blank"><img src="${basePath }/images/wx2lb.gif" alt="" class="bigpic" /></a>
                        <div class="titIntr dark-mask picIntr">
                            <h3><a href="#" target="_blank" title="无心法师2">《无心法师2》首曝预告 场面恢弘制作全面升级</a>
                            </h3>
                            <p><a href="#" target="_blank">这支长达三分半中的预告片以无心的一段内心独白拉开序幕。</a></p>
                        </div>
                    </div>
                    <div class="panRt2">
                        <a href="#" target="_blank"><img src="${basePath }/images/lbdt.jpg" /></a>
                    </div>
                    <div class="panRt3">
                        <a href="#" target="_blank"><img src="${basePath }/images/wxfs.jpg" class="smPic" /></a>
                        <div class="smPicint titIntr">
                            <h3><a href="#" target="_blank" title="无心法师">无心法师</a></h3>
                            <p><a href="#" target="_blank">不老不死的法师无心偶然遇到了逃婚出门的月牙....</a></p>
                        </div>
                    </div>
                </div>
                -->
            </div>
        </div>
        <div class="contr" id="Lctr"><img class="png" src="${basePath }/images/leftbtn.png" /></div>
        <div class="contr" id="Rctr"><img class="png" src="${basePath }/images/ritbtn.png" /></div>
    </div>
    <div class="container">
        <div class="left">
            <h3>最新作品<span>The latest work</span></h3>
            <ul class="filmList">
            <#list workList as work>
                <li>
                    <a href="${basePath }/${work.url}?id=${work.id}" title=""><img src="${work.image}" class="" /></a>
                    <div class="filmIntr">
                        <p>片名：<span class="imp">${work.name}</span></p>
                        <p>${work.title}</p>
                    </div>
                </li>
            </#list>
            </ul>
        </div>
        <div class="mid">
            <h3>最新资讯<span>news</span> <a href="#" target="_blank" class="newsMore">more</a> </h3>
            <ul class="newsList">
            <#list newsList as news>
                <li>
                    <h4><a href="${basePath }/${news.url}?id=${news.id}" target="_blank">${news.title}</a></h4>
                    <div>${news.content}</div>
                </li>
               </#list>
            </ul>
        </div>
        <div class="rit">
            <a title="无心法师2"  href="#" data-vid="1218952">${config_poster.configValue}</a>
            <a href="https://weibo.com/tangrendianying" target="_blank" class="sinabtn sharebtn"></a>
            <a href="http://t.qq.com/tangrendianying2012" target="_blank" class="txbtn sharebtn"></a>
        </div>

    </div>
    <div id="footer">
        <div class="logowrap">
            <a href="/" title="唐人影视">${config_Slogo.configValue}</a>
        </div>
        <div class="copCont">
            <p>${config_ICP.configValue} <a href="http://www.google.com/analytics/" target="_self">&nbsp;</a> 联系电话：${config_Tel.configValue} <a title="法律声明" href="/tr/declaration.shtml" target="_self">法律声明</a> | <a title="联系我们" href="#" target="_self">联系我们</a></p>
            <p>天津唐人影视股份有限公司 版权所有${config_Copyright.configValue}</p>
        </div>
    </div>
    <script>
        var oParent = document.getElementById("container");
        const CheckLoading = (child) => {
            const aContent = getChilds(child);
            const lastTop = aContent[aContent.length - 1].offsetTop;
            const scrollTop = document.documentElement.scrollTop || document.body.scrollTop;
            const pageHeight = document.documentElement.clientHeight || document.body.clientHeight;

            if (scrollTop + pageHeight > lastTop) {
                return true;
            }
        }
        const imgLocation = (child) => {
                //ES6
                //将父级下所有符合条件的子元素全部取出
                const aContent = getChilds(child); //获取子元素数组
                const imgWidth = aContent[0].offsetWidth; //获取图片外边框宽度
                const imgnum = ~~(document.documentElement.clientWidth / imgWidth); //~~位运算，获取一行图片数量
                oParent.style.cssText = 'width:' + imgWidth * imgnum + 'px;margin:0 auto;';
                //计算图片的高度
                const heightArr = [];
                [].map.call(aContent, (current, index) => {
                    if (index < 3) { //超出第一行的图片
                        heightArr.push(current.offsetHeight); /*将图片高度存入数组*/
                    } else {
                        //得到图片的最小高度
                        //es6方法：
                        //const minHeight=Math.min(...heightArr);
                        const minHeight = getMin(heightArr);
                        //得到最小高度图片的序列号
                        const minIndex = getMinIndex(minHeight, heightArr);
                        //reduce方法取最小值
                        /*var arr=[2,1,3,0];
					 var min=arr.reduce((a,b,index,arr)=>{
					     if(a.val>=b){
						     a.val=b;
							 a.index=index;
						 }
						 return a;
					 },{val:arr[0],index:0},)
					 console.log(min);*/
                        //布局图片
                        current.style.position = 'absolute';
                        current.style.top = minHeight + 'px';
                        current.style.left = aContent[minIndex].offsetLeft + 'px';
                        heightArr[minIndex] = heightArr[minIndex] + current.offsetHeight; //更新最小的高度
                    }
                });
                console.log(heightArr);

            }
            //将父级下所有符合条件的子元素全部取出
        const getChilds = (child) => {
            const childArr = [];
            const tagsAll = oParent.getElementsByTagName('*');

            [].map.call(tagsAll, (current) => {
                if (current.className === child) {
                    childArr.push(current);
                }
            });
            return childArr;
        }
        window.addEventListener('load', () => {
            imgLocation('box');

            this.addEventListener('scroll', () => {
                if (CheckLoading('box')) {

                    imgData.map((current) => {
                        const oDiv = document.createElement('div');
                        oDiv.className = 'box';
                        oParent.appendChild(oDiv);
                        const boxImg = document.createElement('div');
                        boxImg.className = 'box-img';
                        oDiv.appendChild(boxImg);
                        const img = new Image();
                        img.src = 'images/' + current.src;
                        boxImg.appendChild(img);
                    })
                    imgLocation('box');
                };
            })

        });

        //得到图片的最小高度
        const getMin = (arr) => {
            const arrlength = arr.length;
            for (var i = 0, ret = arr[0]; i < arrlength; i++) {
                ret = Math.min(ret, arr[i]); /*比较并返回最小值*/
            }
            return ret;
        };
        //得到最小高度图片的序列号
        const getMinIndex = (minHeight, heightArr) => {
            for (var i in heightArr) {
                if (heightArr[i] == minHeight) {
                    return i;
                }
            }
        }
    </script>
    <script>
        (function(i, s, o, g, r, a, m) {
            i['GoogleAnalyticsObject'] = r;
            i[r] = i[r] || function() {
                (i[r].q = i[r].q || []).push(arguments)
            }, i[r].l = 1 * new Date();
            a = s.createElement(o),
                m = s.getElementsByTagName(o)[0];
            a.async = 1;
            a.src = g;
            m.parentNode.insertBefore(a, m)
        })(window, document, 'script', '//www.google-analytics.com/analytics.js', 'ga');

        ga('create', 'UA-43360710-1', 'tangrenmedia.com');
        ga('send', 'pageview');
    </script>

    <script src="${basePath }/js/MSClass.js"></script>
    <script src="${basePath }/js/jquery-1.7.1.min.js"></script>
    <script>
        function $$(id) {
            return document.getElementById(id)
        };

        function scroll() {
            var marquee1 = new Marquee("scroll1");
            marquee1.Direction = "left";
            marquee1.Step = 1;
            marquee1.Width = $(window).width();
            marquee1.Width = $(window).width() - 100;
            marquee1.Height = 470;
            marquee1.Timer = 90;
            marquee1.DelayTime = 0;
            marquee1.WaitTime = 200;
            marquee1.ScrollStep = 1;
            marquee1.BckStep = marquee1.Step;
            marquee1.Start();

            $$("Lctr").onmouseover = function() {
                marquee1.Direction = 3;
                marquee1.Step = marquee1.BckStep + 5;
            };
            $$("Lctr").onmouseout = function() {
                marquee1.Step = marquee1.BckStep;
                marquee1.Direction = 2;
            };
            $$("Rctr").onmouseover = function() {
                marquee1.Direction = 2;
                marquee1.Step = marquee1.BckStep + 5;
            };
            $$("Rctr").onmouseout = function() {
                marquee1.Step = marquee1.BckStep
            };
        }
        var scrl = $('.panel').length;
        var eveli = $('.panel').outerWidth();
        if (scrl * eveli < $(window).width()) {
            $('.panel').clone().appendTo('.panelBox');
            scroll();
        } else {
            scroll();
        }
    </script>
    <script src="${basePath }/js/jquery.jshadow.js"></script>
    <script src="${basePath }/js/swfobject.js"></script>
    <script src="${basePath }/js/global.js"></script>
    <script>
        $.fn.playTheVideo = function(o) {
            var conf = {
                v_id: '302886',
                title: '',
                width: 575,
                height: 325
            };
            o = $.extend(conf, o);
            return this.each(function() {
                var thisId = $(this).attr('id');

                swfobject.embedSWF('http://www.changyou.com/cyouFile/sohuVideo/cyouPlayers.swf', thisId, o.width, o.height, '7',
                    '', {
                        v_id: o.v_id,
                        v_width: o.width,
                        v_height: o.height
                    }, {
                        allowfullscreen: 'true',
                        allowscriptaccess: 'always',
                        wmode: 'transparent'
                    }, {
                        id: o.thisId,
                        name: o.thisId
                    });
            });
        };
        $(function() {

            function playIt(e, s) {
                var elment = $(e);
                var show = $(s);
                elment.click(function() {
                    var vid = $(this).data('vid');
                    var title = this.title;
                    if (!vid) {
                        alert('敬请期待！');
                        return false;
                    }
                    show.empty().append('<div id="replaced" />');
                    $(window).popShadow({
                        elems: '.single-video',
                        event: null,
                        after: function() {
                            $('.single-video .videowrap').append('<div id="replaced"/>');
                            if (title) {
                                $('.single-video h2').text(title);
                            }
                            $('#replaced').playTheVideo({
                                v_id: vid,
                                width: 561,
                                height: 310
                            });
                        }
                    });
                    $('.single-video .close').click(function() {
                        $('#replaced').remove();
                    });
                    return false;
                });
            }

            $(window).resize(function() {
                $('#scroll1').width($(window).width() - 100);
            });
        });
    </script>
</body>

</html>